package com.skywolf.chem.common.sysconfig.pojo.dto;

/**
 * Created by pei_pei on 2020/10/27.
 */

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;

public class PageDTO {
    @ApiModelProperty(
            value = "当前第几页，默认1，从1开始",
            example = "1"
    )
    private long pageNum = 1L;
    @ApiModelProperty(
            value = "每页显示条数，默认10",
            example = "10"
    )
    private long pageSize = 10L;
    @ApiModelProperty("升序排序字段")
    private List<String> ascs;
    @ApiModelProperty("降序排序字段")
    private List<String> descs;

    public IPage page() {
        Page page = new Page();
        page.setCurrent(this.pageNum);
        page.setSize(this.pageSize);
        page.setAscs(this.ascs);
        page.setDescs(this.descs);
        return page;
    }

    public PageDTO() {
    }

    public long getPageNum() {
        return this.pageNum;
    }

    public long getPageSize() {
        return this.pageSize;
    }

    public List<String> getAscs() {
        return this.ascs;
    }

    public List<String> getDescs() {
        return this.descs;
    }

    public void setPageNum(long pageNum) {
        this.pageNum = pageNum;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }

    public void setAscs(List<String> ascs) {
        this.ascs = ascs;
    }

    public void setDescs(List<String> descs) {
        this.descs = descs;
    }

    public boolean equals(Object o) {
        if(o == this) {
            return true;
        } else if(!(o instanceof PageDTO)) {
            return false;
        } else {
            PageDTO other = (PageDTO)o;
            if(!other.canEqual(this)) {
                return false;
            } else if(this.getPageNum() != other.getPageNum()) {
                return false;
            } else if(this.getPageSize() != other.getPageSize()) {
                return false;
            } else {
                label40: {
                    List this$ascs = this.getAscs();
                    List other$ascs = other.getAscs();
                    if(this$ascs == null) {
                        if(other$ascs == null) {
                            break label40;
                        }
                    } else if(this$ascs.equals(other$ascs)) {
                        break label40;
                    }

                    return false;
                }

                List this$descs = this.getDescs();
                List other$descs = other.getDescs();
                if(this$descs == null) {
                    if(other$descs != null) {
                        return false;
                    }
                } else if(!this$descs.equals(other$descs)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof PageDTO;
    }

    public int hashCode() {
        boolean PRIME = true;
        byte result = 1;
        long $pageNum = this.getPageNum();
        int result1 = result * 59 + (int)($pageNum >>> 32 ^ $pageNum);
        long $pageSize = this.getPageSize();
        result1 = result1 * 59 + (int)($pageSize >>> 32 ^ $pageSize);
        List $ascs = this.getAscs();
        result1 = result1 * 59 + ($ascs == null?43:$ascs.hashCode());
        List $descs = this.getDescs();
        result1 = result1 * 59 + ($descs == null?43:$descs.hashCode());
        return result1;
    }

    public String toString() {
        return "PageDTO(pageNum=" + this.getPageNum() + ", pageSize=" + this.getPageSize() + ", ascs=" + this.getAscs() + ", descs=" + this.getDescs() + ")";
    }
}

